<?php
/**
 *
 * @author 李大牛家的牛 (scafel@163.com)
 * @className home.blade.php
 * @createDate 2025/7/27 - 15:01
 * @description
 **/
?>

@include('manage.default.template.header')
<div class="layui-layout layui-layout-admin" id="LDN_APP">
    @include("manage.default.template.layout-header")
    @include("manage.default.template.layout-sider")

    <div class="layui-body">
        <!--页面主要内容-->
        <iframe id="mainIFrame" name="main" src="/manage/welcome" frameborder="0" seamless class="lyear-layout-content"></iframe>
        <!--End 页面主要内容-->
    </div>
    <div class="layui-footer">
        <!-- 底部固定区域 -->
        底部固定区域
    </div>
</div>
@include('manage.default.template.footer')
<script>
    //JS
    layui.use(['layer', 'util', 'interactive'], function(){
        var layer = layui.layer,
            util = layui.util,
            req = layui.interactive;
        //头部事件
        util.event('lay-header-event', {
            loginOut: function (){
                req.get("/manage/login/out", {}, function (res) {
                    top.location.reload();
                })
            },
            clearCache: function (){
                req.get("/manage/cache/clear", {}, function (res) {
                    top.location.reload();
                })
            },
            menuLeft: function(othis){ // 左侧菜单事件
                layer.msg('展开左侧菜单的操作', {icon: 0});
            },
            menuRight: function(){  // 右侧菜单事件
                layer.open({
                    type: 1,
                    title: '更多',
                    content: '<div style="padding: 15px;">处理右侧面板的操作</div>',
                    area: ['260px', '100%'],
                    offset: 'rt', // 右上角
                    anim: 'slideLeft', // 从右侧抽屉滑出
                    shadeClose: true,
                    scrollbar: false
                });
            },
            reloadIFrame: function () {
                var iframe = document.getElementById("mainIFrame");
                iframe.contentWindow.location.reload();
            },
            changePwd: function () {
                layer.open({
                    type: 2,
                    title: '修改密码',
                    content: '/manage/admin/change/password',
                    area: ['500px', '350px'],
                    resize: false,
                    scrollbar: false,
                });
            },
            changeInfo: function () {
                layer.open({
                    type: 2,
                    title: '修改信息',
                    content: '/manage/admin/change/info',
                    area: ['900px', '500px'],
                    scrollbar: false,
                });
            }
        });
        util.event('lay-menu-event', {
            menuClick: function (othis){
                console.log(othis);
            }
        })
    });
</script>
